rename

abstract fun rename(from: String, to: String)

Rename a variable of any type. The value and the type move to the new key. Every block property bound to the variable follows the new key and keeps its value. For a text variable, every {{key}} token in text blocks is rewritten too. Experimental: this API may change in a minor release.

Parameters

from

the current key of the variable.

to

the new key. It must not be empty, start or end with whitespace, contain "{{" or "}}", or name another variable.